// import {login, logout, getInfo} from '@/api/login'
// import {getToken, setToken, removeToken} from '@/utils/auth'


const useUserStore = defineStore(
    'user',
    {
        state: () => ({
            token: getToken(),
            id: '',
            name: '',
            avatar: '',
            roles: [],
            permissions: []
        }),
        actions: {
            // // 退出系统
            // logOut() {
            //     return new Promise((resolve, reject) => {
            //         logout(this.token).then(() => {
            //             this.token = ''
            //             this.roles = []
            //             this.permissions = []
            //             removeToken()
            //             resolve()
            //         }).catch(error => {
            //             reject(error)
            //         })
            //     })
            // }
        }
    }
)

export default useUserStore
